# 保存字典-校验
module.exports.saveValid =
  # 校验规则
  rules:
    dict:
      dict_id: 'required|string|max:32'
      dict_name: 'required|string|max:128'
      dict_items: 'array'

  # 错误提示
  errorTips:
    dict:
      dict_id:
        required:'请输入字典ID'
        string:'字典ID须由文本组成'
        max:'字典ID超过32字符'
      dict_name:
        required:'请输入字典名称'
        string:'字典名称须由文本组成'
        max:'字典名称超过128字符'
      dict_items:
        array:'字典项须由数组组成'

# 删除字典-校验
module.exports.removeValid =
  # 校验规则
  rules:
    dict_ids: 'required|array'

  # 错误提示
  errorTips:
    dict_ids:
      required: '请输入字典ID'
      alpha_num: '字典ID必须是数组'

# 查询字典-校验
module.exports.queryValid =
  # 校验规则
  rules:
    pageNum: 'digits_between:1,16'
    pageSize: 'digits_between:1,16'
  query:
    dict_id: 'string|32'
    dict_name: 'string|128'

  # 错误提示
  errorTips:
    pageNum:
      digits_between: '当前页号必须为1到16位数字'
    pageSize:
      digits_between: '每页记录数必须为1到16位数字'
    query:
      dict_id:
        string:'字典ID须由文本组成'
        max:'字典ID超过32字符'
      dict_name:
        string:'字典名称须由文本组成'
        max:'字典名称超过128字符'

# 查询多个字典-校验
module.exports.querySomeValid =
  # 校验规则
  rules:
    dict_ids: 'required|array'

  # 错误提示
  errorTips:
    dict_ids:
      required: '请输入字典ID数组'
      array: '必须是字典ID数组'

# 查询单个字典-校验 
module.exports.findByIdValid =
  # 校验规则
  rules:
    dict_id: 'required|alpha_num|max:32'

  # 错误提示
  errorTips:
    dict_id:
      required: '请输入字典ID'
      alpha_num: '字典ID必须是字母或数字'
      max: '字典ID长度不能超过32'

# 修改字典-校验
module.exports.updateValid =
  # 校验规则
  rules:
    dict:
      dict_id: 'required|string|max:32'
      dict_name: 'required|string|max:128'
      dict_items: 'array'

  # 错误提示
  errorTips:
    dict:
      dict_id:
        required:'请输入字典ID'
        string:'字典ID须由文本组成'
        max:'字典ID超过32字符'
      dict_name:
        required:'请输入字典名称'
        string:'字典名称须由文本组成'
        max:'字典名称超过128字符'
      dict_items:
        array:'字典项须由数组组成'